home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / AMScen_0_9.lha / AMScen / bguild.m < prev    next >
Text File  |  1995-01-21  |  30KB  |  679 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1995 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * bguild.m - set up the builder's guild.
  9.  */
  10.  
  11. private tp_bguild CreateTable().
  12. use tp_bguild
  13.  
  14. use t_streets
  15.  
  16. define tp_bguild BGUILD_ID NextEffectId().
  17.  
  18. define tp_bguild proc drawGuild()void:
  19.  
  20.     if not KnowsEffect(nil, BGUILD_ID) then
  21.     DefineEffect(nil, BGUILD_ID);
  22.     GSetImage(nil, "bguild");
  23.     IfFound(nil);
  24.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  25.     Else(nil);
  26.         GSetPen(nil, C_TAN);
  27.         GAMove(nil, 123, 26);
  28.         GRDraw(nil, 0, -10);
  29.         GRDraw(nil, 20, 0);
  30.         GRDraw(nil, 0, 10);
  31.         GAMove(nil, 0, 26);
  32.         GRDraw(nil, 158, 0);
  33.         GRDraw(nil, 0, 60);
  34.         GRDraw(nil, -158, 0);
  35.         GRDraw(nil, 0, -60);
  36.         GAMove(nil, 50, 26);
  37.         GRDraw(nil, 0, 60);
  38.         GAMove(nil, 50, 48);
  39.         GRDraw(nil, 58, 0);
  40.         GAMove(nil, 50, 64);
  41.         GRDraw(nil, 58, 0);
  42.         GAMove(nil, 79, 26);
  43.         GRDraw(nil, 0, 22);
  44.         GAMove(nil, 79, 64);
  45.         GRDraw(nil, 0, 22);
  46.         GAMove(nil, 108, 26);
  47.         GRDraw(nil, 0, 22);
  48.         GAMove(nil, 108, 64);
  49.         GRDraw(nil, 0, 22);
  50.     
  51.         GSetPen(nil, C_BROWN);
  52.         GAMove(nil, 59, 48);
  53.         HorizontalDoor();
  54.         GAMove(nil, 88, 48);
  55.         HorizontalDoor();
  56.         GAMove(nil, 59, 64);
  57.         HorizontalDoor();
  58.         GAMove(nil, 88, 64);
  59.         HorizontalDoor();
  60.         GAMove(nil, 128, 26);
  61.         HorizontalDoor();
  62.         GAMove(nil, 50, 52);
  63.         VerticalDoor();
  64.         GAMove(nil, 158, 52);
  65.         VerticalDoor();
  66.  
  67.         GSetPen(nil, C_GOLD);
  68.         GAMove(nil, 13, 59);
  69.         GText(nil, "LIB");
  70.         GAMove(nil, 60, 41);
  71.         GText(nil, "A ");
  72.         GAMove(nil, 89, 41);
  73.         GText(nil, "B ");
  74.         GAMove(nil, 60, 79);
  75.         GText(nil, "W ");
  76.         GAMove(nil, 89, 79);
  77.         GText(nil, "M ");
  78.     Fi(nil);
  79.     EndEffect();
  80.     fi;
  81.     CallEffect(nil, BGUILD_ID);
  82. corp;
  83.  
  84. define tp_bguild GUILD_MAP_GROUP NextMapGroup().
  85.  
  86. define tp_bguild r_buildEntry CreateThing(r_indoors).
  87. SetupRoom(r_buildEntry, "in the foyer of the builder's guild",
  88.     "The floor in here is an expensive-looking black and white tile. Potted "
  89.     "plants abound, as do black leather upholstery and brass fixtures. A long "
  90.     "hallway leads off to the west, a small door half-hidden behind a palm "
  91.     "tree leads north, and the doors out to the street are to the east.").
  92. r_buildEntry@p_rNoMachines := true.
  93. Connect(r_sw2, r_buildEntry, D_WEST).
  94. Connect(r_sw2, r_buildEntry, D_ENTER).
  95. ExtendDesc(r_sw2,
  96.     "There is a fancy entryway here, complete with a somewhat worn red carpet "
  97.     "and overhead marquee. Double glass doors lead into a large entry hall. "
  98.     "There are potted shrubs to either side of the door, and a brass sign "
  99.     "beside the door reads \"Builder's Guild\".").
  100. RoomGraphics(r_buildEntry, "Foyer", "", GUILD_MAP_GROUP, 130, 53, drawGuild).
  101. Sign(r_sw2, "sign;brass.door;brass,sign,beside,the",
  102.     "The brass sign is one of those expensive things carved from a hunk of "
  103.     "brass. The resulting raised letters are brass coloured, and the "
  104.     "carved-out areas are painted flat black.",
  105.     "\"Builder's Guild\"").
  106. Scenery(r_sw2,
  107.     "entryway,entry;fancy."
  108.     "carpet;somewhat,worn,red."
  109.     "marquee;overhead."
  110.     "door;double,glass."
  111.     "hall;large,entry."
  112.     "shrub;potted").
  113. Scenery(r_buildEntry,
  114.     "floor;expensive,black,and,white,tiled."
  115.     "tile;expensive,black,and,white."
  116.     "plant;potted."
  117.     "upholstery;black,leather."
  118.     "fixture;brass."
  119.     "hallway;long."
  120.     "tree;palm."
  121.     "door;small,wooden").
  122. define tp_bguild proc enterBuild()status:
  123.     list action la;
  124.  
  125.     la := Me()@p_pEnterActions;
  126.     /* Could be nil on a directed machine like Packrat */
  127.     if la ~= nil and FindElement(la, checkBuildButton) = -1 then
  128.     AddTail(la, checkBuildButton);
  129.     checkBuildButton();
  130.     fi;
  131.     continue
  132. corp;
  133. AddWestChecker(r_sw2, enterBuild, false).
  134. AddEnterChecker(r_sw2, enterBuild, false).
  135.  
  136. define tp_bguild r_buildHall1 CreateThing(r_indoors).
  137. SetupRoom(r_buildHall1, "in an east-west hallway",
  138.     "On each side of the hall are simple wooden doors. Beside each is a sign "
  139.     "which reads \"Members Only\". The entry hall is to the east.").
  140. Connect(r_buildEntry, r_buildHall1, D_WEST).
  141. RoomGraphics(r_buildHall1, "East", "Hallway", GUILD_MAP_GROUP, 90, 53,
  142.          drawGuild).
  143. Scenery(r_buildHall1, "door;simple,wooden").
  144. Sign(r_buildHall1, "sign", "", "\"Members Only\"").
  145.  
  146. define tp_bguild r_buildHall2 CreateThing(r_indoors).
  147. SetupRoom(r_buildHall2, "in an east-west hallway",
  148.     "On each side of the hall are simple wooden doors. Beside each is a sign "
  149.     "which reads \"Members Only\". A set of double doors to the west marks "
  150.     "the end of the hallway. Beside those doors is a sign which reads "
  151.     "\"Library\".").
  152. Connect(r_buildHall1, r_buildHall2, D_WEST).
  153. RoomGraphics(r_buildHall2, "West", "Hallway", GUILD_MAP_GROUP, 61, 53,
  154.          drawGuild).
  155. Scenery(r_buildHall2, "door;simple,wooden,double").
  156. Sign(r_buildHall2, "sign", "", "").
  157. Sign(r_buildHall2, "sign", "", "").
  158.  
  159. define tp_bguild r_buildLibrary CreateThing(r_indoors).
  160. SetupRoom(r_buildLibrary, "in the builder's library",
  161.     "Rows and rows of shelves here are filled to overflowing with plans, "
  162.     "blueprints, permits, announcements, etc. Most of the material is of no "
  163.     "interest, but one set of volumes bears investigation. Double doors lead "
  164.     "out to the east.").
  165. Connect(r_buildHall2, r_buildLibrary, D_WEST).
  166. UniConnect(r_buildLibrary, r_buildHall2, D_EXIT).
  167. RoomGraphics(r_buildLibrary, "Library", "", GUILD_MAP_GROUP, 21, 53,
  168.          drawGuild).
  169. Scenery(r_buildLibrary,
  170.     "shelves,shelf;rows,and,of."
  171.     "plan."
  172.     "blueprint."
  173.     "announcement."
  174.     "material").
  175. Sign(r_buildLibrary, "volume;set,of.set",
  176.     "The volumes you see are the ones you should read.",
  177.     "Read the volumes by name, one at a time.").
  178.  
  179. define tp_bguild o_buildBook1 CreateThing(nil).
  180. SetupObject(o_buildBook1, r_buildLibrary, "introduction,intro;book,of.book",
  181.     "This tattered volume is right at the beginning of the heap. It is "
  182.     "securely attached to the shelf by a brass chain, so you can't take it "
  183.     "out. The text inside describes the miscellaneous building commands.").
  184. o_buildBook1@p_oNotGettable := true.
  185. o_buildBook1@p_oReadString :=
  186. "The following miscellaneous build (@) commands exist:\n"
  187. "  @showtable <table> - show the symbols defined in the table.\n"
  188. "  @describesymbol <table> <symbol> - describe the given symbol.\n"
  189. "  @deletesymbol <table> <symbol> - delete the given symbol. You must be the\n"
  190. "\towner of the symbol in order to delete it.\n"
  191. "  @movesymbol <fromtable> <totable> <symbol> - move a symbol from one table\n"
  192. "\tto another.\n"
  193. "  @renamesymbol <table> <old-symbol> <new-symbol> - rename a symbol.\n"
  194. "  @flag <table> <symbol> - define a new flag property.\n"
  195. "  @counter <table> <symbol> - define a new counter property.\n"
  196. "  @string <table> <symbol> - define a new string property.\n"
  197. "  @table <table> <symbol> - define a new private table.\n"
  198. "  @use <table> - add table to set used for symbol lookup.\n"
  199. "  @unuse <table> - remove table from set used for symbol lookup.\n"
  200. "  @symbolhere <table> <symbol> - define the given symbol for this room.\n"
  201. "  @poof <symbol> - poof to your given named room.\n"
  202. "Use table name 'private' to refer to your main private symbol table.\n"
  203. "Only an Apprentice or Wizard can make you an official builder.".
  204.  
  205. define tp_bguild o_buildBook2 CreateThing(nil).
  206. SetupObject(o_buildBook2, r_buildLibrary, "rooms,room;book,of.book",
  207.     "This book shows much sign of wear. If it wasn't attached to the wall "
  208.     "with an iron chain, it probably wouldn't be here anymore! Inside, it "
  209.     "details the basic methods for building rooms.").
  210. o_buildBook2@p_oNotGettable := true.
  211. o_buildBook2@p_oReadString :=
  212. "The following forms of the @room (@r) command exist:\n"
  213. "  @room new <dir> <kind> <room-name> - create a new room with a two-way\n"
  214. "\tlink in the indicated direction. <kind> is one of: indoors, forest\n"
  215. "\toutdoors, field, road, path, sidewalk or park. <room-name> is the\n"
  216. "\tstring which will be printed after the 'You are'. E.g.\n"
  217. "\t\t@room new north indoors in a new room\n"
  218. "  @room newname <room-name> - rename the current room.\n"
  219. "  @room same <old-dir> <new-dir> - make a one-way link in direction\n"
  220. "\t<new-dir> which goes the same place as <old-dir> does. E.g.\n"
  221. "\t\t@room same north in\n"
  222. "  @room hide <dir> - toggle the visibility of the given link.\n"
  223. "  @room scenery <word> ... <word> - add scenery words here.\n"
  224. "  @room newdesc - replace the long description of the current room.\n"
  225. "  @room adddesc - append to the long description of the current room.\n"
  226. "  @room setdescaction <action-symbol> - set a descaction proc here.\n"
  227. "  @room linkto <dir> <symbol> - make a one-way link in direction <dir> to\n"
  228. "\tthe room which you have given name <symbol> to.\n"
  229. "  @room unlink <dir> - remove path in the indicated direction.\n"
  230. "  @room dark [ yes | no ] - make the current room dark or light.\n"
  231. "  @room lock [ yes | no ] - lock/unlock the current room for public access.\n"
  232. "  @room status { readonly | wizard | public } - set the status of the\n"
  233. "\tcurrent room with regards to who can build onto it.\n"
  234. "  @room dirdesc <dir> - enter a new direction-specific description for the\n"
  235. "\tcurrent room. This is the message that the character will be shown\n"
  236. "\tif he/she looks in that direction.\n"
  237. "  @room dirmessage <dir> - set the message that the character will see when\n"
  238. "\the/she goes in that direction. <dir> can be 'nogo'.\n"
  239. "  @room diromessage <dir> - set the message that other characters in the\n"
  240. "\tsame room will see when a character goes in the given direction.\n"
  241. "\tThe character's name and a space will be prepended to the message.\n"
  242. "  @room diremessage <dir> - set the message that other characters in the\n"
  243. "\tsame room will see when a character arrives from the given\n"
  244. "\tdirection. Note that the character's name and a space will be\n"
  245. "\tprepended to the message.\n"
  246. "  @room adddircheck <dir> <action-symbol> - enter a new checker procedure\n"
  247. "\tfor going the given direction from the current room. <dir> can also\n"
  248. "\tbe 'anyenter' or 'anyexit'.\n"
  249. "  @room subdircheck <dir> <action-symbol> - remove the checker.\n"
  250. "  @room showdirchecks <dir> - list all checkers for the given direction.\n"
  251. "  @room addspecialaction <action-symbol> <verb-form> - add special action\n"
  252. "\tas in:   @r addspecialaction doSmoogle \"smoogle,grundle\"\n"
  253. "  @room subspecialaction <action-symbol> <verb-form> - remove action.\n"
  254. "  @room checker <table> <action-symbol> - define a checker action.\n"
  255. "  @room descaction <table> <action-symbol> - define a description action.\n"
  256. "  @room specialaction <table> <action-symbol> - define special action.\n"
  257. "  @room makebank - make the current room into a bank.\n"
  258. "  @room makestore - make the current room into a store.\n"
  259. "  @room addforsale <object-symbol> <price> - make object for sale here.\n"
  260. "  @room subforsale <object-symbol> - remove it from sale.".
  261.  
  262. define tp_bguild o_buildBook3 CreateThing(nil).
  263. SetupObject(o_buildBook3, r_buildLibrary, "objects,object,obj;book,of.book",
  264.     "This solid volume is tied to the desk with a steel chain, so you can't "
  265.     "check it out of the library. It details the building of objects.").
  266. o_buildBook3@p_oNotGettable := true.
  267. o_buildBook3@p_oReadString :=
  268. "The following forms of the @object (@o) command exist:\n"
  269. "  @object new <table> <object-symbol> <visible-name> - create a new object\n"
  270. "\twith name <object-symbol> and visible name <visible-name>. E.g.\n"
  271. "\t\t@object new private candle \"candlestick;shiny,brass\"\n"
  272. "  @object newname <object-symbol> <visible-name> - supply new visible name.\n"
  273. "  @object newdesc <object-symbol> - supply new description for the object.\n"
  274. "  @object setdescaction <object-symbol> <action-symbol> - set the action\n"
  275. "\tto be the description action for the object.\n"
  276. "  @object setactword <object-symbol> <word-list> - set the special actions\n"
  277. "\tthat this object can do. E.g.\n"
  278. "\t\t@object setactword candle \"blow,puff,snuff\"\n"
  279. "  @object setactstring <object-symbol> - set the special action string.\n"
  280. "  @object setactaction <object-symbol> <action-symbol> - set special action\n"
  281. "\tprocedure to be triggered by the object's action word.\n"
  282. "  @object gettable <object-symbol> [ yes | no ] - is the object gettable?\n"
  283. "  @object islight <object-symbol> [ yes | no ] - does it emit light?\n"
  284. "  @object invisible <object-symbol> [ yes | no ] - is it seen in room?\n"
  285. "  @object container <object-symbol> <count> - make it a container\n"
  286. "  @object { sitin | siton | liein | lieon } <object-symbol> <count> - E.g.\n"
  287. "\tto make the couch have room for two people to sit on\n"
  288. "\t\t@object siton couch 2\n"
  289. "  @object destroy <table> <object-symbol> - destroy the indicated object.\n"
  290. "  @object checker <table> <action-symbol> - define object checker action.\n"
  291. "  @object descaction <table> <action-symbol> - define a description action.\n"
  292. "  @object actaction <table> <action-symbol> - define a special action.\n"
  293. "XXX := { play | erase | eat | use | activate | deactivate | light |\n"
  294. "\textinguish | wear | read | touch | smell | listen | open | close |\n"
  295. "\tpush | pull | turn | lift | lower }\n"
  296. "  @object XXXstring <object-symbol> - set action string on object.\n"
  297. "\tAlso 'getstring' and 'unlockstring'.\n"
  298. "  @object XXXaction <object-symbol> <action-symbol> - set checker on object.".
  299.  
  300. define tp_bguild o_buildBook4 CreateThing(nil).
  301. SetupObject(o_buildBook4, r_buildLibrary, "procedures,procs;book,of.book",
  302.     "This immaterial book is firmly tied to nothing with an intangible chain, "
  303.     "so you cannot remove it from the library. Inside are many words "
  304.     "detailing the building of checker/action/description procedures.").
  305. o_buildBook4@p_oNotGettable := true.
  306. o_buildBook4@p_oReadString :=
  307. "Checker/action/description procedures are a way of attaching conditions "
  308. "and/or actions to an exit or to an object. "
  309. "They are executed when a character tries to take the exit or do something "
  310. "with the object. "
  311. "They can cause things to happen, such as a message to the character or "
  312. "others, and can conditionally allow the taking of the exit or the"
  313. "completion of the action. "
  314. "They are entered line by line and each line of the procedure is checked for "
  315. "validity against the rules for the kind of procedure being entered. "
  316. "Note that this is NOT full-fledged AmigaMUD programming - wizards and "
  317. "apprentices have access to a much more flexible and powerful programming "
  318. "language.\n\n"
  319. "Checker/action procedures consist of a series (possibly none) of actions to "
  320. "be executed unconditionally; "
  321. "followed by a condition, which is built from none or more simple "
  322. "conditionals; "
  323. "followed by the actions to be executed if the condition succeeds; "
  324. "followed by the actions to be executed if the condition fails. "
  325. "The allowable conditions and actions vary depending on whether the procedure "
  326. "governs a room exit or an object operation. "
  327. "A condition passes only if ALL of its simple conditionals are satisfied. "
  328. "See the books titled 'book of conditionals' and 'book of actions' for "
  329. "details.\n\n"
  330. "Description procedures are used to produce room or object descriptions which "
  331. "vary depending on the state of some variables. "
  332. "They are essentially just a string, as described in the 'book of strings'.".
  333.  
  334. define tp_bguild o_buildBook5 CreateThing(nil).
  335. SetupObject(o_buildBook5, r_buildLibrary,
  336.         "conditionals,cond,condition,conditions,conditional;book,of.book",
  337.     "This book describes the simple conditionals which can be attached to "
  338.     "a checker/action procedure.").
  339. o_buildBook5@p_oNotGettable := true.
  340. o_buildBook5@p_oReadString :=
  341. "'character' and 'room' values can be tested for either exit or object "
  342. "conditionals, but 'object' values must be used appropriately. "
  343. "The 'XXXhasYYY' tests refer to the object being carried by the character, "
  344. "in the room, or in the main object. "
  345. "Each of these simple conditions can be preceeded by 'not' to reverse its "
  346. "test.\n"
  347. "  characterflag/roomflag/objectflag <flag-symbol> - the conditional is true\n"
  348. "\tif the specified flag is 'true'.\n"
  349. "  charactercounter/roomcounter/objectcounter <counter-symbol>\n"
  350. "\t<counter-value> - the conditional is true if the counter has the\n"
  351. "\tgiven value.\n"
  352. "  characterhasspecific/roomhasspecific/objecthasspecific <object-symbol> -\n"
  353. "\tthe conditional is true if the character has the thing, or it is in\n"
  354. "\tthe room, or it is inside the main object. <object-symbol> is the\n"
  355. "\tdefining character's private symbol name for the object.\n"
  356. "  characterhaschild/roomhaschild/objecthaschild <object-symbol> - the\n"
  357. "\tconditional is true if the character/room/object has/contains an\n"
  358. "\tobject cloned from the indicated one (see 'book of actions').\n"
  359. "  characterhasname/roomhasname/objecthasname <name-string> - the\n"
  360. "\tconditional is true if the character/room/object has/contains an\n"
  361. "\tobject whose name matches the given <name-string>. Note that the\n"
  362. "\t<name-string> is in the standard 'noun;adj,adj' format.\n"
  363. "  characterhasflag/roomhasflag/objecthasflag <flag-symbol> - the\n"
  364. "\tconditional is true if the character/room/object has/contains an\n"
  365. "\tobject so flagged.\n"
  366. "  random <chance> - the conditional is true one time out of <chance>.".
  367.  
  368. define tp_bguild o_buildBook6 CreateThing(nil).
  369. SetupObject(o_buildBook6, r_buildLibrary,
  370.         "actions,action,act,acts;book,of.book",
  371.     "This book describes the actions which can be attached to "
  372.     "a checker/action procedure.").
  373. o_buildBook6@p_oNotGettable := true.
  374. o_buildBook6@p_oReadString :=
  375. "'character' and 'room' values can be changed for either exit or object "
  376. "procedures, but 'object' values must be used appropriately.\n"
  377. "  charactersetflag/characterclearflag/roomsetflag/roomclearflag/\n"
  378. "    objectsetflag/objectclearflag <flag-symbol> - the given flag is set or\n"
  379. "\tcleared, as appropriate.\n"
  380. "  characterinccounter/characterdeccounter/roominccounter/roomdeccounter/\n"
  381. "    objectinccounter/objectdeccounter <counter-symbol> - the given counter\n"
  382. "\tis incremented or decremented, as appropriate.\n"
  383. "  charactersetcounter/objectsetcounter/roomsetcounter <counter-symbol>\n"
  384. "\t<value> - the given counter is set to the given value.\n"
  385. "  charactersetstring/objectsetstring/roomsetstring <string-symbol>\n"
  386. "\t<s-val> - the given string property is set based on s-val: 'date' or\n"
  387. "\t'time' give the current date/time as in \"Mon Jan 25 19:47:40 1993\";\n"
  388. "\t'charactername' gives the name of the current character; 'roomname'\n"
  389. "\tgives the name of the room, as in \"in the playpen\"; and\n"
  390. "\t'objectname' gives the object name, as in \"delicate blue vase\".\n"
  391. "  characterclearstring/objectclearstring/roomclearstring <string-symbol> -\n"
  392. "\tthe string property is removed from the character/room/object.\n"
  393. "  clonehere <object-symbol> - a clone of the named object is created and\n"
  394. "\tdeposited in this room.\n"
  395. "  cloneat <room-symbol> <object-symbol> - a clone of the named object is\n"
  396. "\tmade and placed in the indicated room.\n"
  397. "  destruct - the object (only valid there) is destroyed.\n"
  398. "  drop - the object is dropped.\n"
  399. "  setit <kind> <object-symbol> - if kind is 'specific' then the named\n"
  400. "\tobject becomes the main object, which is affected by further actions\n"
  401. "\tin this branch of the procedure. If kind is 'characterchild',\n"
  402. "\t'roomchild' or 'objectchild', then the first object being carried,\n"
  403. "\tin the room or in the object is so set. If kind is 'flag', then\n"
  404. "\tthe first object with that flag set becomes the main object. If\n"
  405. "\tkind is 'name', then the object-symbol must be the visible name of\n"
  406. "\tan object to look for.\n"
  407. "  saycharacter - input mode changes to accept a message which is to be\n"
  408. "\tgiven to the character. See the 'book of strings' for details.\n"
  409. "  sayothers - input mode changes to accept a message which is to be given\n"
  410. "\tto other characters in the same room.\n"
  411. "  if - allows a nested condition/true/false sequence to be inserted. These\n"
  412. "\tcannot be further nested.".
  413.  
  414. define tp_bguild o_buildBook7 CreateThing(nil).
  415. SetupObject(o_buildBook7, r_buildLibrary, "strings,string;book,of.book",
  416.     "This book describes the special things that can be put in strings in "
  417.     "procedures, both description procedures and as part of others.").
  418. o_buildBook7@p_oNotGettable := true.
  419. o_buildBook7@p_oReadString :=
  420. "Most input here is just text that is part of the string. Do not attempt to "
  421. "format the text - the system will format it, along with any other text that "
  422. "is part of the relevant output, according to the width of the player's "
  423. "output device. "
  424. "If a line input here starts with an '@', however, it is a special command "
  425. "which causes things to be put in that place in the string when the string "
  426. "is being used during execution. "
  427. "The special string commands are\n"
  428. "  @characterstring/roomstring/objectstring <string-symbol> - the value of\n"
  429. "\tthe indicated string property is inserted.\n"
  430. "  @charactercounter/roomcounter/objectcounter <counter-symbol> - the value\n"
  431. "\tof the indicated counter is inserted in numeric form.\n"
  432. "  @charactername/roomname/objectname - the name of the character/room/\n"
  433. "\tobject is inserted. See the 'book of actions' for the formats used.".
  434.  
  435. define tp_bguild proc buildCheck()status:
  436.  
  437.     if Me()@p_pBuilder then
  438.     continue
  439.     else
  440.     Print("Not being a member of the guild, you cannot go through "
  441.         "the door.\n");
  442.     fail
  443.     fi
  444. corp;
  445.  
  446. define tp_bguild r_buildOffice1 CreateThing(r_indoors).
  447. SetupRoom(r_buildOffice1, "in a private office",
  448.     "This office is decorated in a traditional British style. Oak panelling "
  449.     "covers the wall, a massive fireplace on the north wall is complete with "
  450.     "a large mantelpiece filled with knick-knacks, and a wool carpet covers "
  451.     "the floor. The furniture consists of a huge oak desk, and several "
  452.     "overstuffed armchairs.").
  453. Connect(r_buildHall1, r_buildOffice1, D_NORTH).
  454. UniConnect(r_buildOffice1, r_buildHall1, D_EXIT).
  455. AddNorthChecker(r_buildHall1, buildCheck, false).
  456. RoomGraphics(r_buildOffice1, "British", "Office", GUILD_MAP_GROUP, 89, 35,
  457.          drawGuild).
  458. Scenery(r_buildOffice1,
  459.     "panelling,panel;oak."
  460.     "wall;oak-panelled,oak,panelled,north."
  461.     "fireplace;massive."
  462.     "mantelpiece;large."
  463.     "knick-knack,knack;knick."
  464.     "carpet;wool."
  465.     "floor."
  466.     "furniture."
  467.     "desk;huge,oak."
  468.     "armchairs,chair;arm,overstuffed").
  469.  
  470. define tp_bguild r_buildOffice2 CreateThing(r_indoors).
  471. SetupRoom(r_buildOffice2, "in a private office",
  472.     "This office sports a distinctly modern look. The desk is of stainless "
  473.     "steel and black plastic, and sports the latest Amiga computer. The "
  474.     "bookcases, shelving, coffee tables, etc. are all of gleaming brass and "
  475.     "glass. Abstract dodads fill much of the shelf space. The couch is much "
  476.     "too low to be comfortable, but is certainly big enough to sleep on.").
  477. Connect(r_buildHall1, r_buildOffice2, D_SOUTH).
  478. UniConnect(r_buildOffice2, r_buildHall1, D_EXIT).
  479. AddSouthChecker(r_buildHall1, buildCheck, false).
  480. RoomGraphics(r_buildOffice2, "Modern", "Office", GUILD_MAP_GROUP, 89, 73,
  481.          drawGuild).
  482. Scenery(r_buildOffice2,
  483.     "desk;stainless,steel,and,black,plastic."
  484.     "computer,keyboard,screen,drive,disk;amiga,disk."
  485.     "shelving,shelves,shelf,table,case;book,coffee,gleaming,brass,and,glass."
  486.     "dodad;abstract."
  487.     "space;shelf."
  488.     "couch;low,big,uncomfortable").
  489.  
  490. define tp_bguild r_buildOffice3 CreateThing(r_indoors).
  491. SetupRoom(r_buildOffice3, "in a private office",
  492.     "This office would be more appropriate in Nairobi! The furniture is all "
  493.     "cane and bamboo, large tubs of tropical plants fill the walls, and you "
  494.     "can even make out mounted animal heads peering through the greenery. "
  495.     "Display cases hold feathered spears, brightly decorated shields, and "
  496.     "gruesome carved masks. Unfortunately, the cases, like everything else "
  497.     "around here, cannot be opened.").
  498. Connect(r_buildHall2, r_buildOffice3, D_NORTH).
  499. UniConnect(r_buildOffice3, r_buildHall2, D_EXIT).
  500. AddNorthChecker(r_buildHall2, buildCheck, false).
  501. RoomGraphics(r_buildOffice3, "African", "Office", GUILD_MAP_GROUP, 60, 35,
  502.          drawGuild).
  503. Scenery(r_buildOffice3,
  504.     "furniture;cane,and,bamboo."
  505.     "tub,plant;large,tubs,of,tropical."
  506.     "wall."
  507.     "head;mounted,animal."
  508.     "greenery."
  509.     "case;display."
  510.     "spear;feathered."
  511.     "shield;brightly,decorated."
  512.     "mask;gruesome,carved.").
  513.  
  514. define tp_bguild r_buildOffice4 CreateThing(r_indoors).
  515. SetupRoom(r_buildOffice4, "in a private office",
  516.     "This office must belong to someone lost in the past! The walls are "
  517.     "covered with vertical log stakes, held together by large iron bands and "
  518.     "spikes. The furniture is all rough-cut wood with a bit of varnish. The "
  519.     "desk looks massive enough to park a car on. Locked gun-cases can be "
  520.     "seen on one wall, while another is full of small, faded photographs of "
  521.     "someone's distant relatives.").
  522. Connect(r_buildHall2, r_buildOffice4, D_SOUTH).
  523. UniConnect(r_buildOffice4, r_buildHall2, D_EXIT).
  524. AddSouthChecker(r_buildHall2, buildCheck, false).
  525. RoomGraphics(r_buildOffice4, "Western", "Office", GUILD_MAP_GROUP, 60, 73,
  526.          drawGuild).
  527. Scenery(r_buildOffice4,
  528.     "wall;vertical,log,stake."
  529.     "band,spike;large,iron."
  530.     "furniture;rough-cut,rough,cut,wood,wooden,varnished."
  531.     "desk;massive."
  532.     "case,gun-case;gun,locked."
  533.     "photograph,relative;small,faded,someone's,distant").
  534.  
  535. define tp_bguild r_buildStairs1 CreateThing(r_indoors).
  536. SetupRoom(r_buildStairs1, "at the top of some stairs",
  537.     "Concrete block walls enclose a small landing here. A drab steel door "
  538.     "opens on the south wall, and dirty metal stairs head down. You can hear "
  539.     "some strange high-pitched noises coming from below.").
  540. Connect(r_buildEntry, r_buildStairs1, D_NORTH).
  541. UniConnect(r_buildStairs1, r_buildEntry, D_EXIT).
  542. RoomGraphics(r_buildStairs1, "Top of", "Stairs", GUILD_MAP_GROUP, 130, 18,
  543.          drawGuild).
  544. Scenery(r_buildStairs1,
  545.     "wall;concrete,block,south."
  546.     "stair;dirty,metal."
  547.     "door;drab,steel").
  548.  
  549. define tp_bguild r_buildStairs2 CreateThing(r_indoors).
  550. SetupRoom(r_buildStairs2, "at the bottom of some stairs",
  551.     "Garbage litters the floor here at the bottom of some rusty metal stairs. "
  552.     "A door in the stained concrete wall leads to the south. You can hear "
  553.     "what sounds like children playing behind it. A sign beside the door "
  554.     "reads \"Playpen - Enter At Own Risk\".").
  555. Connect(r_buildStairs1, r_buildStairs2, D_DOWN).
  556. define tp_bguild o_playpenSign CreateThing(nil).
  557. FakeObject(o_playpenSign, r_buildStairs2, "sign", "").
  558. o_playpenSign@p_oReadString := "\"Playpen - Enter At Own Risk.\"".
  559. Scenery(r_buildStairs2,
  560.     "garbage,litter,floor,door."
  561.     "wall;stained,concrete."
  562.     "stair;rusty,metal").
  563. define tp_bguild proc drawStairsBottom()void:
  564.     GSetPen(nil, C_DARK_BROWN);
  565.     GAMove(nil, 0, 0);
  566.     GRectangle(nil, 159, 99, true);
  567.     GSetPen(nil, C_TAN);
  568.     GAMove(nil, 65, 41);
  569.     GRectangle(nil, 29, 18, false);
  570.     GSetPen(nil, C_BLACK);
  571.     GAMove(nil, 66, 42);
  572.     GRectangle(nil, 27, 16, true);
  573.     GSetPen(nil, C_BROWN);
  574.     GAMove(nil, 75, 59);
  575.     HorizontalDoor();
  576.     DrawUpArrow(C_GOLD);
  577. corp;
  578. AutoGraphics(r_buildStairs2, drawStairsBottom).
  579. RoomName(r_buildStairs2, "Bottom of", "Stairs").
  580.  
  581. define tp_bguild proc enterPlayPen()status:
  582.  
  583.     if Me()@p_pEnterActions = nil then
  584.     /* Do not let Packrat in */
  585.     fail
  586.     else
  587.     if not Me()@p_pBuilder then
  588.         setupBuild();
  589.     fi;
  590.     continue
  591.     fi
  592. corp;
  593.  
  594. define tp_bguild proc scanList(list thing lt)void:
  595.     int count, n;
  596.     thing th;
  597.  
  598.     count := Count(lt);
  599.     n := 0;
  600.     while n < count do
  601.     th := lt[n];
  602.     if th@p_oContents ~= nil then
  603.         scanList(th@p_oContents);
  604.     fi;
  605.     if th@p_rPlayPen then
  606.         AddTail(r_playPen@p_rContents, th);
  607.         DelElement(lt, th);
  608.         th -- p_oCarryer;
  609.         th@p_oWhere := r_playPen;
  610.         Print(FormatName(th@p_oName) + " is dropped.\n");
  611.         count := count - 1;
  612.     else
  613.         n := n + 1;
  614.     fi;
  615.     od;
  616. corp;
  617.  
  618. define tp_bguild proc exitPlayPen()status:
  619.     thing me;
  620.  
  621.     me := Me();
  622.     if not me@p_pBuilder then
  623.     clearBuild();
  624.     fi;
  625.     scanList(me@p_pCarrying);
  626.     continue
  627. corp;
  628.  
  629. /* the room 'r_playPen' is created and used in 'build.m' */
  630. SetupRoom(r_playPen, "in the PLAYPEN",
  631.     "This room is the builder's playpen. Anyone can be a builder in here. "
  632.     "This means that you should be careful of any rooms and/or objects you "
  633.     "find in this area, since they may not have been built very carefully! "
  634.     "The way out of the mayhem is to the north.").
  635. SetThingStatus(r_playPen, ts_public).
  636. Connect(r_buildStairs2, r_playPen, D_SOUTH).
  637. Connect(r_buildStairs2, r_playPen, D_ENTER).
  638. AddSouthChecker(r_buildStairs2, enterPlayPen, false).
  639. AddEnterChecker(r_buildStairs2, enterPlayPen, false).
  640. AddNorthChecker(r_playPen, exitPlayPen, false).
  641. AddExitChecker(r_playPen, exitPlayPen, false).
  642. r_playPen@p_rPlayPen := true.
  643. AutoGraphics(r_playPen, AutoClosedRoom).
  644. AutoPens(r_playPen, C_DARK_BROWN, C_CADMIUM_YELLOW, C_BLUE_GREEN, C_ORANGE).
  645.  
  646. define tp_bguild proc questPhotoDesc()string:
  647.  
  648.     "Bring me a photograph of " + FormatName(Me()@p_pName) + "'s whatzit."
  649. corp;
  650.  
  651. define tp_bguild proc questPhotoGive()status:
  652.     thing photo;
  653.  
  654.     photo := It();
  655.     if MatchName(photo@p_oName,
  656.     "whatzit;photograph,of," + FormatName(TrueMe()@p_pName) + "'s") ~= -1
  657.     then
  658.     GiveToQuestor(FormatName(photo@p_oName));
  659.     if Parent(photo) = o_photograph then
  660.         succeed
  661.     else
  662.         SPrint(TrueMe(), "Questor is not impressed.\n");
  663.         fail
  664.     fi
  665.     else
  666.     continue
  667.     fi
  668. corp;
  669.  
  670. define tp_bguild proc questPhotoHint()string:
  671.  
  672.     "They are impossible to find."
  673. corp;
  674.  
  675. QuestGive("Whatzit", questPhotoDesc, questPhotoGive, questPhotoHint).
  676.  
  677. unuse t_streets
  678. unuse tp_bguild
  679.